#include <iostream>

using std::cout;
using std::endl;

#define PI 3.14

class Circle{
public:
    Circle()
        :_radius(0)
    {

    }
    Circle(double r)
        :_radius(r)
    {

    }

    double getArea(){
        return PI * _radius * _radius;
    }

    double getPerimeter(){
        return 2 * PI *_radius;
    }

    void show(){
        cout << "the circle radius = " << _radius << endl;
        cout << ",area = " << getArea() << endl;
        cout << ",perimeter = " << getPerimeter() << endl;
    }


private:
    double  _radius;
};

class Cylinder : public Circle{
public:
    Cylinder(double r,double h)
        :Circle(r)
         ,_height(h)
    {

    }

    double getVolume(){
        return Circle::getArea() * _height;
    }
    void showVolume(){
        cout << "the volumn of this Cylinder = " << getVolume() << endl;
    }

private:
    double _height;

};

void test(){
    Cylinder c(5, 6);
    c.show();
    c.showVolume();
}

int main()
{
    test();
    return 0;
}

